Image processing method and apparatus, and recording medium

ABSTRACT

A method that quickly corrects an image without inputting more than a required number of rendering instructions. Input image that contains a plurality of objects, and rendering command statements that specify rendering of the plurality of objects are input and analyzed in order to identify the types of objects. If a specific type of object is identified through the identification, a rendering command statement that specifies rendering of the specific type of object is re-input in order to correct the specific type of object. If the specific type of object is not identified through the identification, a rendering command statement needed for execution of image correction is not re-input.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to processing an input image that contains a plurality of objects.

[0003] 2. Description of the Related Art

[0004] In order to properly output an output image to a printer or display device according to image data, it is necessary to perform color processing including color correction, color conversion, and binary coding on each of a plurality of objects constituting an output image according to a type of object. In general, for printing out or displaying an image created by a computer application, a device driver or a device translates a set of rendering instructions sent from the application into an image for a whole page that is represented by image data. The image is then printed out or displayed.

[0005] A set of rendering instructions constitutes a document. Among the rendering instructions issued to a device driver.

[0006] An image rendering instruction specifies rendering of a photographic picture. A text rendering instruction specifies rendering of a text. A graphic rendering instruction specifies rendering of a graphic. The device driver performs color processing suitable for an object according to an instruction, converts the resultant object into an image capable of being output from an output device, and outputs the image.

[0007] In recent years, a color management system permitting color processing optimal for each device, such as, ICM for the Microsoft Windows™ or ColorSync™ released from Apple Inc. has been installed in many computer systems.

[0008] However, even when such a color management system is installed, if an original photographic image is of very poor quality, a high-quality, high-definition output cannot naturally be provided. For example, when an image is produced using digital cameras, which have become popular in recent years, if the exposure is improper, the image having an improper exposure is printed with the improper exposure. An excellent output cannot be provided. To overcome this problem, a user may use image retouch software or the like to perform image correction such as nonlinear color balancing on the whole original image.

[0009] However, when a user who lacks expertise and experience on image correction attempts to correct an image, the process can be very frustrating and time consuming.

[0010] Assume that a document for desktop publishing (DTP) is an existing document that contains an original image to which a photograph that has not been corrected is pasted. In order to correct only the photograph in the original image, a complex task must be carried out. Specifically, the photograph in the original image must be designated and cut out, and then corrected using image retouch software. The resultant photograph is then pasted again to the original image.

[0011] For overcoming the aforesaid disadvantages, U.S. patent Ser. No. 09/336,987 filed on Jun. 11th, 1999 by an applicant, describes a process for automatically correcting object images of a predetermined type contained in an input image according to a color distribution.

[0012] In that application, a printer driver issues a request for print data (a set of rendering instructions), which specifies rendering of an image for a print page, twice to an application or an operating system (OS).

[0013] In the first print data processing flow, print data is analyzed in order to acquire information needed for image correction, that is, preparations are made for execution of image correction.

[0014] In the second print data processing flow, the result of acquisition performed in preparation for execution of image correction is used to correct part of the image rendering instructions that have been judged to be corrected. Color matching is executed, and the rendering instructions are translated into raster image data and the raster image data is developed into a page memory. A print image is then produced and transferred to a printer.

[0015] However, the number of data items per page has increased drastically partly because applications offer advanced performance. If every data is requested twice, a print start time instant is delayed by a time required for issuance of a first request and response to the first request. This greatly affects an image output speed. In particular, a request must be issued twice even for a page that contains no image. The decrease in the speed is undesired.

SUMMARY OF THE INVENTION

[0016] Accordingly, an object of the present invention is to make it possible to perform image correction quickly without the necessity of inputting more than a required number of rendering instructions.

[0017] In other words, an object of the present invention is to reduce processing time required for image correction.

[0018] According to one embodiment of the present invention, there is provided an image processing method for processing an input image containing a plurality of objects. Specifically, rendering command statements that specify rendering of the plurality of objects are input and analyzed in order to identify the types of objects. If a specific type of object is identified through identification, the rendering command statement that specifies rendering of the object is re-input in order to correct the specific type of object. If the specific type of object is not identified through identification, a rendering command statement needed for execution of image correction is not re-input.

[0019] According to another embodiment of the present invention, there is provided an image processing method for correcting a specific type of object in an input image, which contains a plurality of objects, under a condition for image correction dependent on a color distribution. Specifically, rendering command statements that specify rendering of objects belonging to a predetermined area in the input image are input. It is judged whether the rendering command statements each specify rendering of a specific type of object. If there is a possibility that an object thought to be the same as the specific type of object may be present in a subsequent predetermined area, a rendering command statement that specifies rendering of the object belonging to the subsequent predetermined area is input to make the judgment.

[0020] Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.

[0021] Further objects, features and advantages of the present invention will become apparent from the following description of the preferred embodiments with reference to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0022]FIG. 1 is a block diagram of a system configuration;

[0023]FIG. 2 is a flowchart describing image correction in accordance with the first embodiment;

[0024]FIG. 3 is a flowchart describing image correction in accordance with the second embodiment;

[0025]FIG. 4 is an explanatory diagram on the processing of dividing a page image into a plurality of bands;

[0026]FIG. 5 shows an example of the structure of a table;

[0027]FIG. 6 shows an example of the contents of rendering instruction information Image Info;

[0028]FIG. 7 shows an example of the contents of sample information Histogram Info;

[0029]FIG. 8 shows an example of a table listing group ID numbers;

[0030]FIG. 9A and FIG. 9B show two passes of print data processing in accordance with the first embodiment; and

[0031]FIG. 10A and FIG. 10B show two passes of print data processing in accordance with the second embodiment.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0032] The present invention will be described with reference to the drawings below. FIG. 1 schematically shows an example of a system in accordance with the present invention.

[0033] A printer 105, for example, an ink-jet printer and a monitor 106 are connected to a host computer 100. The host computer 100 has software such as application software 101, a printer driver 103, a monitor driver 104, and a color matching module 111 installed therein. The application software 101 includes a word-processing program, a spreadsheet program, and an Internet browser. The printer driver 103 processes a set of rendering instructions (an image rendering instruction, a text rendering instruction, and a graphic rendering instruction) that specify rendering of output images and that are issued from the applications to an operating system (OS) 102, and produces print data. The monitor driver 104 processes the set of rendering instructions issued from the applications, and displays an image on the monitor 106. The color matching module 111 performs color matching in response to a request issued from the driver or application. The host computer 100 includes a central processing unit (CPU) 108, a hard disk driver (HD) 107, a random access memory (RAM) 109, and a read-only memory (ROM) 110 as hardware devices on which the software can run.

[0034] The OS 102 is a program serving as a basis system residing in the computer 100. The OS 102 has an ability (system spooler) to spool a set of rendering instructions that is used to output an image for a page and issued from the applications.

[0035] The first embodiment of the system configuration shown in FIG. 1 is such that Microsoft Windows™ is adopted as an OS in a personal computer, an application enabling printing is installed, and a monitor and a printer are connected to the personal computer.

[0036] At the host computer 100, an application 101 is activated to create output image data using text data, graphic data, and image data. The text data represents characters or the like classified into a text, the graphic data represents a graphic or the like classified into a graphic, and the image data represents an image classified into a natural image. In order to produce a printout based on the output image data, the application 101 issues a printout request to the OS 102, and also issues a set of rendering instructions, which specifies output images, to the OS 102. The set of rendering instructions include a graphic rendering instruction that specifies rendering of the graphic data, and an image rendering instruction that specifies rendering of the image data. The OS 102 spools the set of rendering instructions, and issues a print request and the set of rendering instructions to the printer driver 103, which drives the output printer, in response to the request output from the application. The printer driver 103 processes the print request and the set of rendering instructions, which are received from the OS 102, produces print data based on which the printer 105 can produce a printout, and transfers the print data to the printer 105. If the printer 105 is a raster printer, the printer driver 103 translates the rendering instructions output from the OS into raster data items of red, green and blue, and develops the raster data items into red, green, and blue 24-bit memories in units of a band. The printer driver 103 then converts the raster data items into data items of a format permitting the printer 105 to produce a printout, for example, cyan, magenta, yellow, and black image data items, and transfers the resultant image data items to the printer. Normally, an image for a page represented by the data items stored in the red, green, and blue 24-bit page memories is divided into a plurality of bands, and the data items are converted in units of a band. FIG. 4 shows an example of decomposing a page image into band images.

[0037] Next, printout processing performed by the printer driver 103 will be described below. The printout processing performed by the printer driver 103 falls broadly into five kinds of processing described below.

[0038] (1) Identification

[0039] A type of rendering instruction that specifies rendering of an object and is received from the OS 102 is identified to see whether the object whose rendering is specified by the rendering instruction is a photographic image, a text, or a graphic.

[0040] (2) Image Correction

[0041] Image correction corrects colors that are unbalanced due to a photographic condition or the like.

[0042] A histogram representing a frequency distribution of luminance levels in a photographic image is created in order to determine a condition for nonlinear balancing of colors. The unbalanced colors in the photographic image are then nonlinearly balanced, whereby color balance, a contrast, and saturation of the photographic image are optimized.

[0043] (3) Color Matching

[0044] The color matching module 111 performs color matching using a source profile portraying a source according to input color information contained in a rendering instruction, and a printer profile portraying a printer. The input color information is converted into printer-dependent color information.

[0045] (4) Producing and Developing Raster Data

[0046] Rendering instructions are translated into red, green, and blue raster data items, which represent a pixel comparable to a resolution offered by the printer, according to color information having undergone image correction and color matching. The red, green, and blue raster data items are developed into the red, green, and blue 24-bit page memories.

[0047] (5) Color Processing for Printer

[0048] The red, green, and blue raster data items are subjected to luminance-density conversion, masking, gamma correction, and n-ary coding, and thus converted into cyan, magenta, yellow, and black data items associated with cyan, magenta, yellow, and black recording agents employed in the printer.

[0049] A processing flow followed by the printer driver will be described in conjunction with FIG. 2 and FIG. 3.

[0050] For executing image correction, print data is analyzed in order to acquire information needed for image correction. Preparations are thus made for image correction. using the information acquired in preparation for image correction, only image rendering instructions that specify rendering of objects judged to be corrected are corrected. Therefore, all information concerning the objects to be corrected must be acquired prior to image correction. Normally, an application divides one image into a plurality of portions and outputs the portions. This is intended to use a memory efficiently. In this case, since a driver treats an image in units of a band, the driver cannot acquire image data of bands succeeding a band whose image data is currently treated.

[0051] A printer driver issues a request for print data (whose rendering is specified by a set of rendering instructions), which represents a print image for one page, twice to an Os for the purpose of image correction. In response to each of the first and second requests, the OS issues the whole set of rendering instructions needed to output one page and spooled.

[0052] In the first print data processing flow (first print data processing pass), print data is analyzed in order to acquire information needed for image correction, and preparations are thus made for execution of image processing. In the second print data processing flow (pass), the information acquired in preparation for image correction is used to correct a portion of image rendering instructions that specifies rendering of objects contained in an image and judged to be corrected. The rendering instructions are subjected to color matching, and then translated into raster data. The raster data is developed into page memories. A print image is then produced and transferred to a printer.

[0053]FIG. 2 is a flowchart describing image correction.

[0054] Normally, a driver divides an image for one page into a plurality of bands, and produces and develops raster data in page memories. This contributes to a reduction in the size of a large page memory. Therefore, in the second pass, the data is sampled in units of a band and processed. It is therefore unnecessary to divide a page image into a plurality of bands in the first pass. For processing the page image, the page image need not be divided into bands. However, some OSs cannot change the size of a band between the first and second passes. For this reason, it will be assumed, for discussion purposes, that a page image is divided into bands in the first pass alike.

[0055] At step S101, a program status word Status is initialized to the first pass Pass1. At step S102, the first band position is designated. Normally, a page image is vertically and laterally divided into bands. The left upper corner of the page image is designated as the initial band position. Alternatively, the bands may be treated from right to left or from down to up. In this case, the first band position indicated with coordinates is set to the initial position.

[0056] At step S103, rendering instructions that specify rendering of objects belonging to a band of the page image are selected from a set of rendering instructions. Normally, the OS performs the selection. When the printer driver informs the OS of the current band position, the OS reads rendering instructions, which specify rendering of data representing objects belonging to the band, from a spooler, and returns it.

[0057] At step S104, the program status word Status is checked. However, since Pass1 is initially specified in Status, control is passed to step S105. At step S105, it is checked if an object is an image to be corrected. Image correction employed in the present embodiment is the processing of correcting colors unbalanced due to a photographic condition or the like. The image to be corrected is a photographic image. In general, the photographic image is represented by red, green, and blue data items of 24 bits or more long. An original of an image represented by data of a smaller bit length (for example, an 8-bit palette) is often not a photograph and not regarded as the image to be corrected. Only when the bit length of data representing an image is 24 or more, control is passed to step S106. Otherwise, it is judged that the object is not the image to be corrected, and control is passed to step S107.

[0058] At step S106, the object whose rendering is specified by the image rendering instruction is sampled in order to plot a histogram. A table shown in FIG. 5 is stored in the RAM. One entry is created in the table. Rendering instruction information contained in the image rendering instruction is entered in the table. FIG. 6 shows an example of the contents of rendering instruction information Image Info entered in the table. The contents of rendering instruction information are a rendered position at which an object should be rendered according to an image rendering instruction and which are indicated with coordinates X and Y, a width W of the object, and a height H thereof. Moreover, FIG. 7 shows the contents of sample information Histogram Info. At step S106, a histogram table alone is specified.

[0059] At step S107, it is judged whether data representing all objects belonging to the band has been processed. If not, the processing started at step S103 is repeated.

[0060] In contrast, if it is judged at step S107 that a current object is the last object belonging to the band, it is judged at step S108 whether the band is the last band of the page image. If the band is not the last band of the page image, the band position is advanced at step S109. Assuming that a page image is vertically divided into bands and data representing the page image is processed from up to down, a vertical size of each band is added to the band position. Thus, the band position is advanced to the next one. Thereafter, the processing succeeding step S103 is repeated.

[0061] In contrast, if it is judged at step S108 that the band is the last band of the page image, control is passed to step S110. By the time when control is passed to step S110, the same number of entries as the number of image rendering instructions, which specify rendering of objects that are images to be corrected contained in an output page, has been created in the image information table shown in FIG. 5. Rendering instruction information Image Info contained in a rendering instruction that specifies rendering of an object and sample information Histogram Info are specified in each entry. At step S110, the entries in the image information table are grouped. Some applications divide one image into portions and issue a plurality of image rendering instructions. Objects of one image that is divided into portions by an application are grouped portion by portion, and histograms concerning grouped objects are synthesized. Specifically, items of rendering instruction information Image Info specified in all entries in the table are compared mutually. Information items contained in a plurality of image rendering instructions that specify rendering of objects of one image that is divided into portions by an application are grouped portion by portion.

[0062] Various procedures are possible as a grouping procedure. A simple procedure will be described. Namely, items of rendering instruction information Image Info specified in all entries in the table are referenced mutually. Entries designating objects that are judged to adjoin according to the rendered position information of values X, Y, W, and H are classified into the same group. For example, coordinates X and widths W specified in two entries in the table agree with each other, and the sum of a coordinate Y and a height H specified in one of the entries agrees with a coordinate Y specified in the other entry. In this case, objects designated with the entries are judged to join each other.

[0063] When any other procedure is adopted for grouping, information to be specified in Image Info may be varied depending on the adopted procedure.

[0064]FIG. 8 shows the contents of the table in which group identification (ID) numbers determined as the result of judgment are entered. Objects designated with indices 0 and 2 are judged to belong to the same group, and 0 is specified as group ID numbers associated with the indices. 1 is specified as group ID numbers associated with indices 1, 3, and 4. After grouping is completed, sample information Histogram Info associated with the same group ID number is synthesized. For synthesizing sample information, the frequencies of the same luminance level are added up, and a new histogram is created. Consequently, the table shown in FIG. 8 has five entries but the entries are grouped into two entries.

[0065] At step S111, a histogram representing a frequency distribution of luminance levels in grouped objects is used to calculate a correction parameter employed in image correction. The result of the calculation is specified in Histogram Info in the entries with which the grouped objects are designated.

[0066] It may be judged from the histogram that correction is not needed. At step S111, whether correction is needed is judged and specified in a correction needed-or-not flag nested below Histogram Info.

[0067] The first print data processing flow or pass is thus completed. A step S112, the program status word Status is changed to the second pass Pass2. The processing of step S102 and thereafter is carried out.

[0068] All the steps ending at step S104 in the second pass are identical to those in the first pass. At step S113, it is judged similarly to at step S105 whether an object concerned is an image to be corrected. Since it may be judged at step S111 that correction is not needed, it is checked if information concerning an object is listed in the table created at step S106 and if the correction needed-or25 not flag specified in Histogram Info at step S111 is set to Correction Needed. However, some correction methods do not judge at step S111 that correction is not needed. In this case, it may be checked at step S106 if information concerning an object is listed in the table.

[0069] If it is judged at step S113 that the object is an image to be corrected, a correction parameter specified in Histogram Info entered in the table created at step S106 or S111 is used to execute image correction. Control is then passed to step S155. If it is judged at step S133 that the object is not an image to be corrected, step S114 is skipped and control is passed to step S115.

[0070] At step S115, raster data is, as mentioned above, produced and developed into the band memories. At step S116, it is checked if data representing all objects belonging to the band has been processed. If the data representing all the objects has not been processed, the processing started at step S103 is repeated. If the data representing all the objects has been processed, the data in the band memories is subjected to printer-dependent color processing at step S117 so that the data can be output to the printer. The resultant data is then output to the printer at step S118. At step S119, it is judged whether data representing all the objects belonging to all bands in the page image has been processed. If not, the next band position is designated at step S120. The processing started at step S103 is repeated. If it is judged at step S119 that the band is the last band of the image page, the sequence is terminated.

[0071] As mentioned above, a histogram representing a frequency distribution of luminance levels in a photographic image is created in order to find out a condition for nonlinear color balancing. Nonlinear color balancing is then performed on the photographic image. Consequently, color balance, a contrast, and saturation in the photographic image can be optimized.

[0072] According to the two-pass processing method employed in the first embodiment, as shown in FIG. 9A and FIG. 9B, a request for print data is issued twice per band irrespective of whether an object contained in a photographic image is present in the band. Recently, data has become more and more complex. Therefore, it takes time to respond a request for print data representing an entire page image. In particular, even when a request for print data is issued twice, if the print data represents a page image containing no photographic image, the first issuance leads to no processing and is therefore of no use. This reduces processing speed.

[0073] According to a second embodiment, a request for print data is issued twice for a band of a page image for which two times of issuance are needed. This is intended to increase processing speed. For example, as shown in FIG. 9A, a photographic image may be present in some bands. In this case, a request for print data is issued twice for processing data that represents an object, that is, the photographic image belonging to band 1 to band 3. The request for print data is issued once for processing data that represents objects belonging to band 4 and subsequent bands. Moreover, a page image may contain no photographic image as shown in FIG. 9B. In this case, the request for print data is issued once. A decrease in processing speed deriving from two passes of processing is thus prevented.

[0074] Image correction will be described below. FIG. 3 is a flowchart showing a flow of image processing.

[0075] At step S201, a variable is initialized. A normal status Normal is included in addition to the first pass status Pass1 and second pass status Pass2 employed in the first embodiment. The initial value specified in Status is Normal. In the normal status, data that represents an object that is not an image to be corrected is developed into the band memories in the same manner as when image correction is not performed. A flag indicates whether an object that is an image to be corrected exists over bands, though it will be detailed later. The initial value of the flag is 0 indicating that an object that is an image to be corrected does not exist over bands.

[0076] At steps S202 and S203, similarly to those in the first embodiment, the band position is initialized, and then data representing objects belonging to a band is sampled. At step S24, the program status word Status is checked. Since Normal is initially specified in Status, control is passed to step S205. At step S205, it is checked whether an object is an image to be corrected. Similarly to step S105, only when the object is represented with data of 24 bits or more, control is passed to step S208. Otherwise, the object is judged not to be an image to be corrected. Control is then passed to step S206.

[0077] At step S206, raster data is, as mentioned above, produced and developed into the band memories.

[0078] At step S207, it is judged if a current band is the last band of a page image. If not, the processing started at step S203 is repeated until the current band becomes the last band thereof or an object that is an image to be corrected is detected.

[0079] Next, a description will be made of processing to be performed when it is judged at step S205 that a current object is an image to be corrected. If it is judged at step S205 that the object is an image to be corrected, two passes of processing are needed for the band containing the object. Control is then passed to step S208. Normal specified in Status is changed to Pass1. At step S209, the current band position is set to the start point for two passes of processing, that is, to 2PassStart.

[0080] Thereafter, at step S210, rendering instruction information Image Info and sample information Histogram Info are entered in the table. At step S211, an object concerning to which a histogram is plotted is extended to the next band. If the object is split and extended over bands, the remaining part of the object may be output with processing of data representing objects that belong to the next band. For this reason, the first pass of processing must involve the objects belonging to the next band. It is therefore judged at step S211 whether the rendered position of the object covers a border between bands. It is then judged from the result of judgment whether the object is extended to the next band. If it is judged that the object is extended to the next band, the flag is set to 1 at step S212.

[0081] Thereafter, it is judged whether the processing of data that represents all objects belonging to a current band has been completed. If processing of data has not been completed, the processing started at step S203 is performed. At this time, when control is returned to step S203, Pass1 is specified in Status. Step S204 is succeeded by step S214.

[0082] At step S214, similar to step S205, it is checked if a current object is an image to be corrected. If not, nothing need be performed in the first pass Pass1. Control is passed to step S213. If it is judged at step S214 that the object is an image to be corrected, processing from step S210 to step S213 is performed.

[0083] Next, a description will be made of a case where it is judged at step S213 that a current band is the last band of a page image. If it is judged that the current band is the last band of the page image, control is passed to step S215. At step S215, it is judged whether data that represents all objects belonging to the next band is also processed in the first pass. If it is judged at step S211 that an object concerning which a histogram has been plotted is extended to the next band, the flag is set to 1 at step S212, and the current band is not the last one of the page image, the data that represents all the objects belonging to the next band must also be processed in the first pass. Control is passed to step S216.

[0084] At step S216, the flag is set back to 0. At step S217, the next band position is designated. As for the band position, for example, when a page image is vertically divided into bands and data that represents the page image is processed from up to down, a vertical size of a band is added to a current band position. Thus, the next band position is designated. Thereafter, the processing started at step S203 is repeated.

[0085] In contrast, if it is found at step S215 that the current band is the last band of the page image or the flag is set to 0, the second pass of processing is performed to process the data that represents the objects belonging to the band and that has been processed in the first pass. First, at step S218, similar to step S110, objects contained in one image, which is divided into bands by an application, are grouped in order to synthesize histograms concerning the objects.

[0086] At step S219, similar to step S111, the synthetic histogram representing a frequency distribution of luminance levels in the grouped objects is used to calculate a correction parameter employed in image correction. Moreover, it is judged whether correction is needed.

[0087] The first pass of print data processing is terminated. At step S220, Pass2 is specified in Status.

[0088] The second pass Pass2 is performed to process data that represents all the objects belonging to a band and that has been processed in the first pass Pass1. It will be judged later whether the second pass is terminated. At step S221, therefore, the current band position is set to the end point for the second pass, that is, to 2PassEnd.

[0089] At step S222, the first band position for the second pass Pass2 is designated. At step S209, the start point for the second pass, that is, 2PassStart is regarded as the band position. Control is then returned to step S203.

[0090] Thereafter, step S204 is performed. Since Pass2 is specified in Status, control is passed to step S224. At step S224, similarly to at step S113, it is judged whether a current object is an image to be corrected. If it is judged that the current object is an image to be corrected, image correction is performed at step S225, and control is passed to step S206, which has been described previously. In contrast, if the current object is not an image to be corrected, step S225 is skipped and control is returned to step S206. Step S207, which has been described previously, is then performed.

[0091] Next, a description will be made of a case where it is judged at step S207 that the current band is the last band of a page image. If it is judged at step S207 that the current band is the last band of the page image, it means that data, which represents objects belonging to all bands of a page image, has been processed. The data in the band memories is output to the printer. First, at step S223, printer-dependent color processing is performed as mentioned previously. At step S224, the resultant data is output to the printer.

[0092] Thereafter, it is judged at step S255 whether the current band is the last band of the page image. If so, the sequence is terminated. In contrast, if it is judged at step S225 that the current band is not the last band of the page image, data that represents objects belonging to the next band is processed. If Pass2 is currently specified in Status, it is judged whether the second pass Pass2 has been terminated. It is checked at step S226 if Pass2 is specified in Status and the current band position is set to 2PassEnd.

[0093] If it is found at step S226 that Pass2 is specified in Status and the current band position is set to 2PassEnd, the second pass Pass2 terminates. At step S227, therefore, the value specified in Status is returned to Normal. At step S228, the next band position is designated. The processing started at step S203 is repeated. Even after the value specified in Status is returned to Normal, if an object is judged as an image to be corrected, the first and second passes are repeated. The sequence is repeated until it is judged at step S225 that the current band is the last band of the page image.

[0094] As mentioned above, two passes of processing are executed for a band for which the two passes are needed. FIG. 10A and FIG. 10B show the results of processing the same data as FIG. 9A and FIG. 9B according to the second embodiment. When an image contains a photographic image as shown in FIG. 10A, data that represents an object of the image, that is, the photographic image belonging to band 1 to band 3 is processed in two passes. Data that represents objects belonging to the remaining bands is processed with the program status word set to Normal, and two passes of processing are not carried out. When an image contains no photographic image as shown in FIG. 10B, two passes of processing are not performed to process data that represents objects belonging to all bands of the image, and the data is therefore processed quickly.

[0095] According to the present embodiment, an area in an image for which a request for data is issued twice can be minimized and a decrease in processing speed can be avoided. In particular, a decrease in processing speed occurring when data representing a page image that does not contain a photographic image is processed can be avoided almost completely.

[0096] Specifically, when a predetermined type of object contained in an input image is automatically corrected based on a color distribution, the number of areas in the input images for which a request for data is issued twice is minimized to thus minimize a reduction in processing speed. In particular, a decrease in processing speed occurring when data representing a page image that does not contain a photographic image is processed can be nearly completely avoided.

[0097] In the aforesaid embodiments, histograms are grouped after the first pass Pass1 is completed. Alternatively, before a histogram representing a frequency distribution of luminance levels in each object contained in an image is plotted, objects may be grouped. In this case, the number of tables each detailing sample information Histogram Info can be decreased.

[0098] According to another embodiment, a software program for realizing the facility in accordance with the aforesaid embodiment (for example, the facility described in the flowchart of FIG. 2 or FIG. 3) is installed in a computer included in an apparatus or system. The computer is connected to various types of devices so that the devices will cooperate with the facility in accordance with the aforesaid embodiment. The computer (CPU or MPU) included in the system or apparatus is acted according to the installed program, thus causing various types of devices to act accordingly.

[0099] Moreover, the software program itself realizes the facility in accordance with the aforesaid embodiment. The program itself, and a means for use in installing the program in the computer, for example, a recording medium in which the program is stored are features of the present invention.

[0100] The recording medium in which the program is stored includes, for example, a floppy disk, a hard disk, an optical disk, a magnetooptical disk, a CD-ROM, a magnetic tape, a nonvolatile memory card, and a ROM.

[0101] Moreover, when the computer runs the installed program, the facility in accordance with the aforesaid embodiment is realized. Even when the program acts in cooperation with an operating system (OS) that resides in the computer or any other application software in order to realize the facility in accordance with the aforesaid embodiment, the program is an embodiment of the present invention.

[0102] According to another embodiment, a supplied program is stored in a memory included in a functional extension board included in a computer or a functional extension unit connected to the computer. Thereafter, a CPU or the like mounted on or in the functional extension board or functional extension unit performs part or the whole of actual processing according to instructions described in the program. The processing realizes the aforesaid facility in accordance with the embodiment.

[0103] Many different embodiments of the present invention can be made without departing from the spirit and scope thereof, it is to be understood that the invention is not limited to the specific embodiments thereof except as defined in the appended claims.

[0104] While the present invention has been described with reference to what are presently considered to be the preferred embodiments, it is to be understood that the invention is not limited to the disclosed embodiments. On the contrary, the invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions. 

What is claimed is:
 1. An image processing method for processing an input image that contains a plurality of objects comprising the steps of: inputting rendering command statements that specify rendering of the plurality of objects; analyzing the rendering instructions; identifying the types of objects; and if a specific type of object is identified through the identification step, re-inputting the rendering command statement that specifies rendering of the specific type of object so as to correct the specific type of object, wherein if the specific type of object is not identified through the identification step, a rendering command statement needed for execution of image correction is not re-input.
 2. An image processing method according to claim 1 , wherein said specific type of object is a photographic image.
 3. An image processing method according to claim 1 , further comprising: outputting data representing the corrected object to an image formation unit; executing said image processing method by a printer driver; and inputting said rendering command statements from an operating system, which resides in a computer.
 4. An image processing method according to claim 1 , further comprising: identifying the types of objects; and plotting a histogram when a type of object is said specific type, the histogram uses a rendering command statement that specifies rendering of the object; and correcting the object whose rendering is specified by the re-input rendering command statement under a condition for image correction drawn from the histogram.
 5. An image processing method according to claim 1 , further comprising dividing said input image containing said plurality of objects into a plurality of portions.
 6. An image processing method for correcting a specific type of object in an input image, which contains a plurality of objects, under a condition for image correction dependent on a color distribution, said image processing method comprising the steps of: inputting rendering command statements that specify rendering of objects belonging to a predetermined area in the input image; judging whether said rendering command statements each specify rendering of a specific type of object; and if an object is judged to be the same as the specific type of object that belongs to another predetermined area, a rendering command statement that specifies rendering of the object belonging to the other predetermined area is input to make the judgment.
 7. An image processing method according to claim 6 , further comprising: judging whether a plurality of objects judged to be of said specific type is the same objects; and correcting the plurality of objects judged to be the same objects.
 8. An image processing method according to claim 7 , wherein when an object judged to be of said specific type lies on a border between said predetermined area and an adjoining predetermined area, it is judged that there is a possibility that an object thought to be the same as said specific type of object belongs to the adjoining predetermined area.
 9. An image processing apparatus for processing an input image that contains a plurality of objects comprising: identifying means for inputting rendering command statements that specify rendering of the plurality of objects, analyzing the rendering command statements, and identifying the types of objects; and image correcting means for, when a specific type of object is identified through the identification, re-inputting a rendering command statement that specifies rendering of the specific type of object so as to correct the specific type of object, wherein when said identifying means fails to identify the specific type of object, a rendering command statement needed for execution of image correction is not re-input.
 10. An image processing apparatus for correcting a specific type of object in an input image, which contains a plurality of objects, under a condition for image correction dependent on a color distribution, said image processing apparatus comprising: input means for inputting rendering command statements that specify rendering of objects belonging to a predetermined area in the input image; and judging means for judging whether the rendering command statements each specify rendering of a specific type of object, wherein when there is a possibility that an object thought to be the same as the specific type of object belongs to the next predetermined area, a rendering command statement that specifies rendering of the object belonging to the next predetermined area is input to make the judgment.
 11. A recording medium in which a program readable by a computer is recorded, comprising: inputting rendering command statements that specify rendering of the plurality of objects; analyzing the rendering command statements; identifying the types of objects; and if a specific type of object is identified through the identification step, re-inputting a rendering command statement that specifies rendering of the specific type of object, and correcting the specific type of object, wherein if the specific type of object is not identified through the identification, a rendering command statement needed for execution of image correction is not re-input.
 12. A recording medium in which a program readable by a computer is recorded, comprising: an image processing method for correcting a specific type of object in an input image, which contains a plurality of objects, under a condition for image correction dependent on a color distribution, wherein said image processing method comprises the steps of: inputting rendering command statements that specify rendering of objects belonging to a predetermined area in the input image; judging whether the rendering command statements each specify rendering of a specific type of object; and when there is a possibility that an object thought to be the same as the specific type of object belongs to the next predetermined area, inputting a rendering command statement that specifies rendering of the object belonging to the next predetermined area so as to make the judgment. 